local skynet = require "skynet"
local mysql = require "skynet.db.mysql"

local s = require "service"
local table_utils = require "table_utils"


s.resp.query_player_data = function(source, id)
    local sql = string.format("select username, exp, gold, diamond, fight_info, scene_info, bag_info, skill_info, created from users where uid=%d", id)
    skynet.error("query sql:", sql)
    local res = s.db:query(sql)

    if #res == 0 then
        return false, res
    end

    skynet.error("res:" .. table_utils.table2string(res))

    return true, res[1]
end
